home *** CD-ROM | disk | FTP | other *** search
Wrap
Text File | 1991-11-06 | 54.2 KB | 1,660 lines
Newsgroups: comp.sources.misc From: dan%step.uucp@uunet.uu.net (Daniel Weaver) Subject: v25i030: ted - Terminfo/termcap test program, Part05/07 Message-ID: <1991Nov6.043011.6058@sparky.imd.sterling.com> X-Md4-Signature: 7f8bf736f5cee6df986b721589f2ff2a Date: Wed, 6 Nov 1991 04:30:11 GMT Approved: kent@sparky.imd.sterling.com Submitted-by: dan%step.uucp@uunet.uu.net (Daniel Weaver) Posting-number: Volume 25, Issue 30 Archive-name: ted/part05 Environment: UNIX #! /bin/sh # This is a shell archive. Remove anything before this line, then feed it # into a shell via "sh file" or similar. To overwrite existing files, # type "sh file -c". # The tool that generated this appeared in the comp.sources.unix newsgroup; # send mail to comp-sources-unix@uunet.uu.net if you want that tool. # If this archive is complete, you will see the following message at the end: # "End of archive 5 (of 7)." # Contents: GRIPES charset.c ted.c # Wrapped by dan@step on Fri Nov 1 11:28:27 1991 PATH=/bin:/usr/bin:/usr/ucb ; export PATH if test -f 'GRIPES' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'GRIPES'\" else echo shar: Extracting \"'GRIPES'\" \(1788 characters\) sed "s/^X//" >'GRIPES' <<'END_OF_FILE' XNotes accumulated while writting ted. X X1) It would be very nice to have a capability to read the character X under the cursor. X X2) A cap for no scroll should exist. X X3) Pads should always be truncated (never rounded). Every escape X sequence has the hidden pad time needed to collect the character X following the escape sequence. If pad times are truncated then X a small pad time at 9600 baud will automatically translate to X no pad at 300 baud. X X4) The padding baud rate is very poorly defined. Its usage is spotty. X tput() ignores the value. The current baud rate should be provided X in the basic support package (rather than full curses). This X would permit tput() to use it. Note: the $<n/> should always be X output. A numeric cap should be included to divide pads by 2 at a X given baud rate. (May not be needed if number 3 is implemented.) X X5) It is very difficult, if not impossible, to tell when a terminal X is through with its command stream. Try to time 100 clear screens. X The operating system could tell you when the last character was sent X but the terminal may still be buffering up data to process. X It would be nice to have a capability to enquire about the X terminals state (busy/idle). Many terminals use ENQ for this X type of handshake. X X6) A cap should be included for changing the baud rate. X X7) A numeric cap should be included to say how many colors are in the X color palette. Due to the 16 bit nature of terminfo this value X could be the cube root of the number of colors. X X8) init_acs() should be moved to the terminfo library so that it may be X used without curses. The hls conversion routines should also be X moved from curses to terminfo. X X9) The set clock capability (sclk) has no description of its arguments. END_OF_FILE if test 1788 -ne `wc -c <'GRIPES'`; then echo shar: \"'GRIPES'\" unpacked with wrong size! fi # end of 'GRIPES' fi if test -f 'charset.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'charset.c'\" else echo shar: Extracting \"'charset.c'\" \(24367 characters\) sed "s/^X//" >'charset.c' <<'END_OF_FILE' X/* X** This software is Copyright (c) 1991 by Daniel Weaver. X** X** Permission is hereby granted to copy, distribute or otherwise X** use any part of this package as long as you do not try to make X** money from it or pretend that you wrote it. This copyright X** notice must be maintained in any copy made. X** X** Use of this software constitutes acceptance for use in an AS IS X** condition. There are NO warranties with regard to this software. X** In no event shall the author be liable for any damages whatsoever X** arising out of or in connection with the use or performance of this X** software. Any use of this software is at the user's own risk. X** X** If you make modifications to this software that you feel X** increases it usefulness for the rest of the community, please X** email the changes, enhancements, bug fixes as well as any and X** all ideas to me. This software is going to be maintained and X** enhanced as deemed necessary by the community. X*/ X/* test alternate character sets and graphics modes */ X X#include "curses.h" X#include "ted.h" X Xstruct mode_list alt_modes[] = { X "normal", "(sgr0)", "(sgr0)", 1, X "standout", "(smso)", "(rmso)", 2, X "underline", "(smul)", "(rmul)", 4, X "reverse", "(rev)", "(sgr0)", 8, X "blink", "(blink)", "(sgr0)", 16, X "dim", "(dim)", "(sgr0)", 32, X "bold", "(bold)", "(sgr0)", 64, X "invis", "(invis)", "(sgr0)", 128, X "protect", "(prot)", "(sgr0)", 256, X "altcharset", "(smacs)", "(rmacs)", 512}; X X/* On many terminals the underline attribute is the last scan line. X This is OK unless the following line is reverse video. X Then the underline attribute does not show up. The following map X will reorder the display so that the underline attribute will X show up. */ Xint mode_map[10] = {0, 1, 3, 4, 5, 6, 7, 8, 9, 2}; X Xstruct graphics_pair { X char c; X char *name; X}; X Xstruct graphics_pair glyph[] = { X '+', "arrow pointing right", X ',', "arrow pointing left", X '.', "arrow pointing down", X '0', "solid square block", X 'I', "lantern symbol", X '_', "arrow pointing up", X '`', "diamond", X 'a', "checker board (stipple)", X 'f', "degree symbol", X 'g', "plus/minus", X 'h', "board of squares", X 'j', "lower right corner", X 'k', "upper right corner", X 'l', "upper left corner", X 'm', "lower left corner", X 'n', "plus", X 'o', "scan line 1", X 'p', "scan line 3", X 'q', "horizontal line", X 'r', "scan line 7", X 's', "scan line 9", X 't', "left tee (|-)", X 'u', "right tee (-|)", X 'v', "bottom tee(_|_)", X 'w', "top tee (T)", X 'x', "vertical line", X 'y', "less/equal", X 'z', "greater/equal", X '{', "Pi", X '|', "not equal", X '}', "UK pound sign", X '~', "bullet", X '\0', "\0"}; X X#ifdef TESTCAP X Xstatic char tc_buffer[4096]; /* buffer to hold new termcap strings */ Xstatic char *tcb = tc_buffer; /* pointer into termcap string buffer */ Xextern char tgetflag(); Xextern int tgetnum(); Xextern CHARSTAR tgetstr(); X X/* In this scheme, characters in the alternate character sets have X seperate termcap entries */ Xstruct cap_graphics { X char *single_cap; /* termcap entry name for single lines */ X char *double_cap; /* termcap entry name for double lines */ X char *name; /* expanded text name */ X}; X Xstatic char *cap_single[256]; Xstatic char *cap_double[256]; Xstatic char *dual_caps[5][5][5]; Xstatic char cap_cookies[5]; X Xstruct cap_mode_list { X char *name; X char *begin_mode, *end_mode; X char *cookie_count; X int attr; X}; X X#ifdef TC Xstruct cap_graphics tcg[] = { X "gv", "GV", "vertical line", X "gh", "GH", "horizontal line", X "g1", "G1", "top right corner", X "g4", "G4", "bottom right corner", X "g2", "G2", "top left corner", X "g3", "G3", "bottom left corner", X "gd", "GD", "down-tick character (T)", X "gl", "GL", "left-tick character (-|)", X "gr", "GR", "right-tick character (|-)", X "gc", "GC", "middle intersection", X "gu", "GU", "up-tick character (_|_)", X 0, 0, 0}; X Xstruct cap_mode_list cap_alt_modes[] = { X "inverse", "so", "se", "sg", 1, X "underline", "us", "ue", "ug", 2, X "blink", "bo", "be", "bb", 3, X "dim", "it", "ie", "ig", 4, X "graphics", "GS", "GE", "GG", 5, X 0, "a3", "A3", 0, 0x24, X 0, "a8", "A8", 0, 0x23, X 0, "b0", "B0", 0, 0x25, X 0, "a7", "A7", 0, 0x41, X 0, "a6", "A6", 0, 0x21, X 0, "b3", "B3", 0, 0x321, X 0, "b4", "B4", 0, 0x51, X 0, "b5", "B5", 0, 0x251, X 0, "b2", "B2", 0, 0x31, X 0, 0, 0, 0, 0 }; X X#else X#ifdef XENIX Xstruct cap_graphics tcg[] = { X "gv", "GV", "vertical line", X "gh", "GH", "horizontal line", X "g1", "G1", "top right corner", X "g4", "G4", "bottom right corner", X "g2", "G2", "top left corner", X "g3", "G3", "bottom left corner", X "gd", "GD", "down-tick character (T)", X "gl", "GL", "left-tick character (-|)", X "gr", "GR", "right-tick character (|-)", X "gc", "GC", "middle intersection", X "gu", "GU", "up-tick character (_|_)", X#ifdef WHO_KNOWS X "f1", "F1", "S/D top right corner", X "f4", "F4", "S/D bottom right corner", X "f2", "F2", "S/D top left corner", X "f3", "F3", "S/D bottom left corner", X "fd", "FD", "S/D down-tick character (T)", X "fl", "FL", "S/D left-tick character (-|)", X "fr", "FR", "S/D right-tick character (|-)", X "fc", "FC", "S/D middle intersection", X "fu", "FU", "S/D up-tick character (_|_)", X#endif X 0, 0, 0}; X Xstruct cap_mode_list cap_alt_modes[] = { X "inverse", "so", "se", "sg", 1, X "underline", "us", "ue", "ug", 2, X "blink", "bo", "be", "bb", 3, X "dim", "it", "ie", "ig", 4, X "graphics", "GS", "GE", "GG", 5, X 0, "a3", "A3", 0, 0x24, X 0, "a8", "A8", 0, 0x23, X 0, "b0", "B0", 0, 0x25, X 0, "a7", "A7", 0, 0x41, X 0, "a6", "A6", 0, 0x21, X 0, "b3", "B3", 0, 0x321, X 0, "b4", "B4", 0, 0x51, X 0, "b5", "B5", 0, 0x251, X 0, "b2", "B2", 0, 0x31, X 0, 0, 0, 0, 0 }; X X#else X#ifdef MV Xstruct cap_graphics tcg[] = { X "GV", "GGV", "vertical line", X "GH", "GGH", "horizontal line", X "G1", "GG1", "top right corner", X "G4", "GG4", "bottom right corner", X "G2", "GG2", "top left corner", X "G3", "GG3", "bottom left corner", X "GD", "GGD", "Down-tick character (T)", X "GL", "GGL", "Left-tick character (-|)", X "GR", "GGR", "Right-tick character (|-)", X "GC", "GGC", "middle intersection", X "GU", "GGU", "Up-tick character (_|_)", X 0, 0, 0}; X Xstruct cap_mode_list cap_alt_modes[] = { X "standout", "so", "se", "sg", 1, X "underline", "us", "ue", "ug", 2, X "graphics", "GS", "GE", "GG", 3, X "blink", "mb", "me", 0, 4, X "dim", "mh", "me", 0, 5, X "bold", "md", "me", 0, 6, X "overstrike","mo", "me", 0, 7, X 0, 0, 0, 0, 0 }; X#endif X#endif X#endif X#endif X Xtest_status() X { X int i, max; X char *s; X static char m[] = "*** status line *** 123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789."; X X can_test("(hs)(wsl)(tsl)(fsl)(dsl)"); X if (stop_testing) return; X X if (has_status_line != 1) X { X ptextln("Terminal has no status line (hs)"); X return; X } X X max = width_status_line == -1 ? columns : width_status_line; X sprintf(temp, "Terminal has status line of %d characters", max); X ptextln(temp); X put_str("This line s"); X s = tparm(to_status_line, 0); X putp(s); X for (i = 0; i < max; i++) putchp(m[i]); X putp(from_status_line); X putln("hould not be broken"); X (void) wait_here(); X if (dis_status_line) X { X ptextln("Disable status line (dsl)"); X putp(dis_status_line); X } X else ptextln("Terminal can not disable status line (dsl)"); X } X X Xeat_cookie() X { /* put a blank if this is not a magic cookie terminal */ X if (magic_cookie_glitch < 1) putchp(' '); X } X X Xput_mode(s) Xchar *s; X { /* send the attribute string (with or without % execution) */ X#ifdef SVR3_2 X putp(tparm(s)); /* allow % execution */ X#else X putp(s); /* ignore % */ X#endif X } X X Xvoid Xset_attr(a) Xint a; X { /* set the attribute from the bits in a */ X int i, b[32]; X X if (magic_cookie_glitch > 0) char_count += magic_cookie_glitch; X if (a == 0 && exit_attribute_mode) X { X put_mode(exit_attribute_mode); X return; X } X for (i = 0; i < 31; i++) b[i] = (a >> i) & 1; X putp(tparm(set_attributes, b[1], b[2], b[3], b[4], b[5], X b[6], b[7], b[8], b[9])); X } X X Xstatic void Xtest_sgr() X { X int i, j; X X maybe_wait(12); X if (!exit_attribute_mode) X ptextln("Terminal has no (sgr0) entry"); X ptext("Test video attributes (sgr)"); X X for (i = 0; i < (sizeof(alt_modes) / sizeof(struct mode_list)); X i++) { X put_crlf(); X sprintf(temp, "%d %-20s", i, alt_modes[i].name); X put_str(temp); X set_attr(alt_modes[i].number); X sprintf(temp, "%s", alt_modes[i].name); X put_str(temp); X set_attr(0); X } X maybe_wait(14); X putln("Double mode test"); X for (i = 0; i <= 9; i++) { X sprintf(temp, " %2d ", mode_map[i]); X put_str(temp); X } X for (i = 0; i <= 9; i++) { X put_crlf(); X sprintf(temp, "%d", mode_map[i]); put_str(temp); X for (j = 0; j <= 9; j++) { X eat_cookie(); X set_attr((1 << mode_map[i]) | (1 << mode_map[j])); X put_str("Aa"); X set_attr(0); X if (j < 9) eat_cookie(); X } X } X put_crlf(); X#ifdef SVR3_2 X if (max_attributes >= 0) X { X sprintf(temp, "(ma) Maximum attributes %d", max_attributes); X put_crlf(); X ptextln(temp); X } X#endif X } X X X#if defined(TC) || defined(XENIX) || defined(MV) Xstatic void Xtest_attr_mode() X { /* test TC sytle attributes */ X int i, j, v, cookies; X char *cap_start, *cap_end; X char *test_string = "123ABCXYZabcxyz"; X char *missing_string = "*** missing ***"; X X if (stop_testing) X { X for (i = 0; cap_alt_modes[i].begin_mode; i++) { X cap_test(cap_alt_modes[i].begin_mode); X cap_test(cap_alt_modes[i].end_mode); X cap_test(cap_alt_modes[i].cookie_count); X } X return; X } X maybe_wait(18); X for (i = j = 0; cap_alt_modes[i].begin_mode; i++) { X if (cap_start = tgetstr(cap_alt_modes[i].begin_mode, &tcb)) X if (!cap_start[0]) cap_start = NULL; X if (cap_end = tgetstr(cap_alt_modes[i].end_mode, &tcb)) X if (!cap_end[0]) cap_end = NULL; X cookies = tgetnum(cap_alt_modes[i].cookie_count, &tcb); X if (cap_start || cap_alt_modes[i].name) X { X if (cookies < 0) cookies = 0; X if (cap_alt_modes[i].name) X { X if (j < cookies) j = cookies; X } X else cookies = j; X putchp(LEFT_BRACE); X put_str(cap_alt_modes[i].begin_mode); X putchp(RIGHT_BRACE); putchp(' '); X if (cookies < 1) putchp(' '); X if (cap_start) X { X putp(cap_start); X put_str(test_string); X putp(cap_end); X } X else put_str(missing_string); X if (cookies < 1) putchp(' '); X putchp(' '); putchp(LEFT_BRACE); X put_str(cap_alt_modes[i].end_mode); X putchp(RIGHT_BRACE); X if (cap_alt_modes[i].cookie_count) X { X putchp(' '); putchp(LEFT_BRACE); X put_str(cap_alt_modes[i].cookie_count); X putchp(RIGHT_BRACE); X sprintf(temp, " %d", cookies); X put_str(temp); X } X for (v = cap_alt_modes[i].attr; v; v >>= 4) { X putchp(' '); X put_str(cap_alt_modes[(v & 15) - 1].name); X } X put_crlf(); X } X } X } X#else X X Xstatic void Xtest_one_attr(n, begin_mode, end_mode) Xint n; Xchar *begin_mode, *end_mode; X { /* test attributes without (sgr) */ X int i; X X sprintf(temp, "%-10s %s ", alt_modes[n].name, X alt_modes[n].begin_mode); X ptext(temp); X for ( ; char_count < 19; ) putchp(' '); X if (begin_mode) X { X putchp('.'); X put_mode(begin_mode); X put_str(alt_modes[n].name); X for (i = strlen(alt_modes[n].name); i < 13; i++) X putchp(' '); X if (end_mode) X { X put_mode(end_mode); X sprintf(temp, ". %s", alt_modes[n].end_mode); X } X else X { X set_attr(0); X strcpy(temp, ". (sgr)"); X } X ptextln(temp); X } X else X { X for (i = 0; i < magic_cookie_glitch; i++) X putchp('*'); X put_str("*** missing ***"); X for (i = 0; i < magic_cookie_glitch; i++) X putchp('*'); X put_crlf(); X } X } X X Xstatic void Xtest_attr_mode() X { X if (stop_testing) X { X int i; X X for (i = 0; i < 9; i++) { X can_test(alt_modes[i].begin_mode); X can_test(alt_modes[i].end_mode); X } X can_test("sgr"); X return; X } X maybe_wait(11); X putln("Test video attributes"); X test_one_attr(1, enter_standout_mode, exit_standout_mode); X test_one_attr(2, enter_underline_mode, exit_underline_mode); X test_one_attr(9, enter_alt_charset_mode, exit_alt_charset_mode); X if (!exit_attribute_mode && !set_attributes) X { X ptextln("(sgr0) exit attribute mode is not defined."); X return; X } X test_one_attr(3, enter_reverse_mode, exit_attribute_mode); X test_one_attr(4, enter_blink_mode, exit_attribute_mode); X test_one_attr(5, enter_dim_mode, exit_attribute_mode); X test_one_attr(6, enter_bold_mode, exit_attribute_mode); X test_one_attr(7, enter_secure_mode, exit_attribute_mode); X test_one_attr(8, enter_protected_mode, exit_attribute_mode); X } X#endif X X#if defined(SVR3) || defined(TC) || defined(XENIX) || defined(MV) X#define GLYPHS 256 X#undef acs_map X Xstatic void Xdump_acs() X { /* display all posible acs characters */ X int i, c; X X put_clear(); X ptextln("The following characters are available. (smacs) (rmacs)"); X for (i = ' '; i <= '`'; i += 32) { X put_crlf(); X put_mode(exit_alt_charset_mode); X for (c = 0; c < 32; c++) { X putchp(c + i); X } X put_crlf(); X put_mode(enter_alt_charset_mode); X for (c = 0; c < 32; c++) { X putchp(c + i); X } X put_mode(exit_alt_charset_mode); X put_crlf(); X } X put_mode(exit_alt_charset_mode); X (void) wait_here(); X } X X Xstatic int Xtest_acs() X { /* alternate character set */ X int i, j; X char valid_glyph[GLYPHS]; X char acs_map[GLYPHS]; X static char vt100[] = "`afgjklmnopqrstuvwxyz{|}~"; X X#ifdef SVR3 X if (stop_testing) X { X can_test("(acsc)(enacs)(smacs)(rmacs)"); X return 0; X } X line_count = 0; X for (i = 0; i < GLYPHS; i++) { X valid_glyph[i] = FALSE; X acs_map[i] = i; X } X if (acs_chars) X { X sprintf(temp, "Alternate character set map: %s", X expand(acs_chars)); X putln(temp); X for (i = 0; acs_chars[i]; i += 2) { X if (acs_chars[i + 1] == 0) break; X for (j = 0; ; j++) { X if (glyph[j].c == acs_chars[i]) X { X acs_map[glyph[j].c] = acs_chars[i + 1]; X valid_glyph[glyph[j].c] = TRUE; X break; X } X if (glyph[j].name[0] == '\0') X { X sprintf(temp, " %c %s", acs_chars[i], X "*** has no mapping ***"); X putln(temp); X break; X } X } X } X } X else X { X ptextln("acs_chars not defined (acsc)"); X /* enable the VT-100 graphics characters (default) */ X for (i = 0; vt100[i]; i++) { X valid_glyph[vt100[i]] = TRUE; X } X } X if (ena_acs) putp(ena_acs); X for (i = 0; glyph[i].name[0]; i++) { X if (valid_glyph[glyph[i].c]) X { X put_mode(enter_alt_charset_mode); X put_this(acs_map[glyph[i].c]); char_count++; X put_mode(exit_alt_charset_mode); X sprintf(temp, " %-30.30s", glyph[i].name); X put_str(temp); X if (char_count + 33 >= columns) put_crlf(); X if (line_count >= lines) X { X (void) wait_here(); X put_clear(); X } X } X } X if (char_count > 1) put_crlf(); X#ifdef ACS_ULCORNER X maybe_wait(5); X putln("Here are 2 boxes"); X put_mode(enter_alt_charset_mode); X put_this(ACS_ULCORNER); put_this(ACS_TTEE); X put_this(ACS_URCORNER); put_this(ACS_ULCORNER); X put_this(ACS_HLINE); put_this(ACS_URCORNER); X char_count += 6; X if (move_standout_mode) put_crlf(); X else X { X put_mode(exit_alt_charset_mode); X put_crlf(); X put_mode(enter_alt_charset_mode); X } X put_this(ACS_LTEE); put_this(ACS_PLUS); put_this(ACS_RTEE); X put_this(ACS_VLINE); X if (magic_cookie_glitch >= 1) put_this(' '); X else X { X put_mode(exit_alt_charset_mode); X put_this(' '); X put_mode(enter_alt_charset_mode); X } X put_this(ACS_VLINE); X char_count += 6; X if (move_standout_mode) put_crlf(); X else X { X put_mode(exit_alt_charset_mode); X put_crlf(); X put_mode(enter_alt_charset_mode); X } X put_this(ACS_LLCORNER); put_this(ACS_BTEE); X put_this(ACS_LRCORNER); put_this(ACS_LLCORNER); X put_this(ACS_HLINE); put_this(ACS_LRCORNER); X char_count += 6; X put_mode(exit_alt_charset_mode); X put_crlf(); X#endif X#else /* TESTCAP */ X if (stop_testing) X { X for (i = 0; tcg[i].single_cap; i++) { X cap_test(tcg[i].single_cap); X cap_test(tcg[i].double_cap); X } X can_test("(smacs)(rmacs)"); X return 0; X } X /* display graphics characters for termcap style graphics */ X putln("single double"); X for (i = 0; tcg[i].single_cap; i++) { X cap_single[i] = tgetstr(tcg[i].single_cap, &tcb); X cap_double[i] = tgetstr(tcg[i].double_cap, &tcb); X putchp(LEFT_BRACE); X put_str(tcg[i].single_cap); X putchp(RIGHT_BRACE); putchp(' '); X if (cap_single[i] && cap_single[i][0]) X { X putchp(' '); X put_mode(enter_alt_charset_mode); X put_str(cap_single[i]); X put_mode(exit_alt_charset_mode); X putchp(' '); X } X else put_str("***"); X putchp(' '); putchp(LEFT_BRACE); X put_str(tcg[i].double_cap); X putchp(RIGHT_BRACE); putchp(' '); X if (cap_double[i] && cap_double[i][0]) X { X putchp(' '); X put_mode(enter_alt_charset_mode); X put_str(cap_double[i]); X put_mode(exit_alt_charset_mode); X putchp(' '); X } X else put_str("***"); X putchp(' '); X putln(tcg[i].name); X } X#endif X return wait_here(); X } X#endif X X Xvoid Xtest_charset() X { /* test begins here */ X int ch; X X if (run_test(bell, "Terminal has no bell (bel)", FALSE)) X do { X new_test(2); X sprintf(temp, "Testing bell (bel), %s", expand(bell)); X ptextln(temp); X putp(bell); X } while (repeat_test(FALSE)); X X if (run_test(flash_screen, X "Terminal has no flash screen (flash)", FALSE)) X do { X new_test(2); X ptextln("Testing visual bell (flash)"); X putp(flash_screen); X } while (repeat_test(FALSE)); X X#ifdef TC X new_test(6); X if (run_test(cursor_invisible, X "Terminal has no cursor off (civis)", FALSE)) X do { X ptext("(civis) Turn off the cursor."); X putp(cursor_invisible); X } while (repeat_test(FALSE)); X X can_test(":CO"); X sprintf(temp, "Terminal has no cursor on %cCO%c", X LEFT_BRACE, RIGHT_BRACE); X if (run_test(cursor_on, temp, FALSE)) X do { X putchp(LEFT_BRACE); X put_str("CO"); X putchp(RIGHT_BRACE); X put_str(" Turn on the cursor."); X putp(cursor_on); X } while (repeat_test(FALSE)); X X if (run_test(cursor_visible, X "Terminal has no cursor_visible (cvvis)", FALSE)) X do { X ptext("(cvvis) Make cursor very visible."); X putp(cursor_visible); X } while (repeat_test(FALSE)); X#else X new_test(6); X can_test("(civis)(cvvis)"); X X if (cursor_normal && run_test(cursor_invisible, X "Terminal has no cursor off (civis)", FALSE)) X do { X ptext("(civis) Turn off the cursor."); X putp(cursor_invisible); X } while (repeat_test(FALSE)); X X if (cursor_normal && run_test(cursor_visible, X "Terminal has no cursor_visible (cvvis)", FALSE)) X do { X ptext("(cvvis) Make cursor very visible."); X putp(cursor_visible); X } while (repeat_test(FALSE)); X#endif X if (run_test(cursor_normal, X "Terminal has no cursor_normal (cnorm)", FALSE)) X do { X ptext("(cnorm) Normal cursor."); X putp(cursor_normal); X } while (repeat_test(FALSE)); X X do { X test_status(); X } while (repeat_test(FALSE)); X X#if defined(SVR3) || defined(TC) || defined(XENIX) || defined(MV) X if (stop_testing) (void) test_acs(); X else X#endif X#if defined(SVR3) X if (enter_alt_charset_mode || acs_chars) X#endif X#if defined(SVR3) || defined(TC) || defined(XENIX) || defined(MV) X { X putln("Display graphics symbols"); X (void) wait_here(); X put_clear(); X ch = 0; X do { X /* for terminals that use seperate fonts for X attributes (such as X windows) the line drawing X characters must be checked for each font. */ X if (ch >= '0' & ch <= '8') X { X set_attr(alt_modes[ch - '0'].number); X ch = test_acs(); X set_attr(0); X } X else ch = test_acs(); X } while (ch == 'r' || ch == 'R' || (ch >= '0' && ch <= '9')); X if (enter_alt_charset_mode) dump_acs(); X put_clear(); X } X#if defined(SVR3) X else ptextln("Terminal has no alternate character set (smacs)"); X#endif X#endif X X do { X test_attr_mode(); X } while (repeat_test(FALSE)); X X#ifndef TESTCAP X if (run_test(set_attributes, X "Terminal has no set attribute command (sgr)", TRUE)) X do { X test_sgr(); X } while (repeat_test(FALSE)); X#endif X } END_OF_FILE if test 24367 -ne `wc -c <'charset.c'`; then echo shar: \"'charset.c'\" unpacked with wrong size! fi # end of 'charset.c' fi if test -f 'ted.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'ted.c'\" else echo shar: Extracting \"'ted.c'\" \(25007 characters\) sed "s/^X//" >'ted.c' <<'END_OF_FILE' X/* X** This software is Copyright (c) 1991 by Daniel Weaver. X** X** Permission is hereby granted to copy, distribute or otherwise X** use any part of this package as long as you do not try to make X** money from it or pretend that you wrote it. This copyright X** notice must be maintained in any copy made. X** X** Use of this software constitutes acceptance for use in an AS IS X** condition. There are NO warranties with regard to this software. X** In no event shall the author be liable for any damages whatsoever X** arising out of or in connection with the use or performance of this X** software. Any use of this software is at the user's own risk. X** X** If you make modifications to this software that you feel X** increases it usefulness for the rest of the community, please X** email the changes, enhancements, bug fixes as well as any and X** all ideas to me. This software is going to be maintained and X** enhanced as deemed necessary by the community. X*/ X/* test terminal capabilities */ X X#define MAIN X X#include "curses.h" X#include "ted.h" X X/* X This program is designed to test terminfo, not curses. Therefore X I have used as little of curses as possible. X X Pads associated with the following capabilities are used to set X delay times in the handler: (cr), (ind), (cub1), (ff), (tab). X X I use the (nxon) capability to set the tty handler with/without X xon/xoff. If (smxon)/(rmxon) is defined I will change the terminal X too. X X (xon) inhibits the sending of delay characters in putp(). X If the terminal is defined with no padding then the (xon) boolian X is a don't care. In this case I recommend that it be reset. X */ X Xchar *op_list[] = { X " -a test alternate character set", X " -A test ANSI status reports", X " -c test color", X " -C test cursor", X "+-d set/reset tty handler delays (default: off)", X " -D <num> debug level", X " -e echo test", X "+-E terminal uses eight bit data", X " -f test function keys", X " -g ANSI graphics mode display", X " -G ANSI character sets", X "+-H output the echo test in hex (default: off)", X " -i do not send init strings", X " -j <num> junk characters before ACK (default: 0)", X " -k compare with known caps", X " -K list known capabilities", X " -l lengthen pad tests to 20 sec. (default: 5 sec.)", X " -m test modes", X "+-n force (nxon) set/reset xon/xoff in tty handler (default: off)", X " -p test pad", X " -P test printer", X "+-q terminal does not use ENQ/ACK", X " -Q <num> ... Enquire sequence (in decimal) (default: 5)", X " -r resume pad testing at [cap]", X " -s shorten pad tests to 2 sec. (default: 5 sec.)", X " -S status report test", X "+-t translate \\b\\f\\n\\r\\t to/from default (default: off)", X " -T <num> terminating character (in decimal) (default: 6)", X " -u use Down/Up kbd scan mode", X " -v verify baud rate", X "+-x force (xon) set/reset (toggles pads) (default: off)", X " -X run pad tests with XON/XOFF and ENQ/ACK", X (char *) 0}; X Xextern char ttytype[]; X XFILE *debug_fp; Xint debug_char_count, debug_level; Xchar temp[512]; Xchar tty_basename[64]; Xchar tty_shortname[64]; X/* control.c */ Xint test_count; /* counts how many times end_test() was called */ Xint tty_can_sync; /* TRUE if tty_sync_error() returned FALSE */ Xint ACK_char; /* -T terminating ACK character */ Xint junk_chars; /* -j number of junk characters */ Xchar tty_ENQ[32]; /* -Q enquire string */ Xchar tty_ACK[TTY_ACK_SIZE]; /* ACK string, set by tty_sync_error() */ Xchar *current_test; /* text name of current test */ Xchar done_test[128]; /* holds the Done message */ Xlong start_time; /* start of test (in seconds) */ Xlong end_time; /* end of test (in seconds) */ Xint capper; /* points into cap_list[] for time tests */ Xstruct cap_tab cap_list[CAP_MAX]; /* holds time test results */ Xchar *ced_name[EDIT_MAX]; /* cap name used for pad edit */ Xchar **ced_value[EDIT_MAX]; /* cap value used for pad edit */ Xint milli_pad; /* accumulated pad in 10 microsecond units */ Xint milli_reps; /* multiplicative pad in 10 microsecond units */ Xint pad_sent; /* number of characters for pad */ Xint rerun; /* used with -X option to rerun a test */ Xint skip_next; /* skip the remaining tests for this cap */ X/* pad.c */ Xint cap_tested; /* set by test_pad() if a cap was tested */ Xint stop_testing; /* force all testing to stop (used by Quit) */ Xint resume_testing; /* set by -r option to resume pad tests */ Xchar letter; /* current character being displayed */ Xint letter_number; /* points into letters[] */ Xint rated_lines; /* baud rate sensitive number of lines */ Xint augment, reps; /* number of characters (or lines) effected */ Xint ops; /* number of operations done */ Xlong full_test; /* test_length seconds worth of characters */ Xlong char_max; /* max characters for this test */ Xlong char_sent; /* number of characters sent (including pads) */ Xint clear_select; /* points into clr_test_value[] */ Xint clr_test_value[CLEAR_TEST_MAX]; Xint clr_test_reps[CLEAR_TEST_MAX]; Xchar *cap_select; /* points to cap to test */ X/* output.c */ Xint char_count; /* counts characters */ Xint line_count; /* counts line feeds */ Xint expand_chars; /* length of expand() string */ Xint replace_mode; /* used to output replace mode padding */ Xint can_go_home; /* TRUE if we can fashion a home command */ Xint can_clear_screen; /* TRUE if we can somehow clear the screen */ X/* ted.c - options and modes */ Xint translate_mode; /* -t option - translate tab, bs, cr, lf, ff */ Xint scan_mode; /* -u option - use scan codes */ Xint building_cap_list; /* -k option - report known caps */ Xint write_ted_file; /* -X option - write ted.$TERM file */ Xint time_pad; /* -X option - run the time tests */ Xint test_length; /* -s -l options - test length in seconds */ Xint char_mask; /* +E -> 0xFF else 0x7F, eight bit data mask */ Xint select_delay_type; /* +-d option - set handler delays */ Xint select_pads; /* +-x option - 0->no pads, 1->pad, 2->no change */ Xint select_xon_xoff; /* +-n option - new value of (xon) */ Xint xon_xoff_state; /* original value of (xon) */ X/* sysdep.c */ Xint tty_frame_size; /* asynch frame size times 2 */ Xunsigned long tty_baud_rate; /* baud rate - bits per second */ Xint tty_abort; /* stty abort character */ Xint not_a_tty; /* TRUE if output is not a tty (i.e. pipe) */ Xint nodelay_read; /* TRUE if NDELAY is set */ X X/* translate mode default strings */ Xchar *TM_carriage_return = "\r"; Xchar *TM_cursor_down = "\n"; Xchar *TM_scroll_forward = "\n"; Xchar *TM_newline = "\r\n"; Xchar *TM_cursor_left = "\b"; Xchar *TM_bell = "\007"; Xchar *TM_form_feed = "\f"; Xchar *TM_tab = "\t"; X Xop_scan(c) Xint c; X { /* scan the op_list[] for c, return c if found, else 0 */ X int i, j; X char *s; X X for (i = 0; op_list[i]; i++) { X if (op_list[i][2] == c) return c; X } X /* option not found */ X put_str("usage: ted [-"); X for (i = 0; op_list[i]; i++) putchp(op_list[i][2]); X putln("] [baud] [cap ...]"); X /* print the long ones */ X for (i = 0; op_list[i]; i++) { X j = strlen(op_list[i]) + 3; X if (j + j >= columns) X { X put_str(" "); putln(op_list[i]); X } X } X /* print the short ones */ s = NULL; X for (i = 0; op_list[i]; i++) { X j = strlen(op_list[i]) + 3; X if (j + j < columns) X if (s) X { X sprintf(temp, " %-*s %s", X (columns / 2) - 4, s, op_list[i]); X putln(temp); X s = NULL; X } X else s = op_list[i]; X } X if (s) X { X put_str(" "); putln(s); X } X bye_kids(1); X return 0; X } X X Xstatic Xput_name(cap, name) Xchar *cap, *name; X { /* send the cap name followed by the cap */ X if (cap) X { X ptext(name); X putp(cap); X } X } X X Xreport_cap(tag, s) Xchar *tag, *s; X { /* expand the cap or print *** missing *** */ X int i; X X ptext(tag); X for (i = char_count; i < 13; i++) putchp(' '); X put_str(" = "); X if (s) putln(expand(s)); X else putln("*** missing ***"); X } X X Xdisplay_basic() X { /* display the basic terminal definitions */ X#ifdef TESTCAP X putln("\nTermcap test program"); X#else X putln("\nTerminfo test program"); X#endif X put_str("\nName: "); X putln(ttytype); X X maybe_wait(14); X report_cap("\\r ^M (cr)", carriage_return); X report_cap("\\n ^J (ind)", scroll_forward); X report_cap("\\b ^H (cub1)", cursor_left); X report_cap("\\t ^I (ht)", tab); X report_cap("\\f ^L (ff)", form_feed); X report_cap(" (clear)", clear_screen); X report_cap(" (home)", cursor_home); X report_cap(" (nel)", newline); X report_cap(" ENQ", tty_ENQ); X X sprintf(temp, "\nTerminal size: %d x %d", columns, lines); X putln(temp); X sprintf(temp, "\nBaud rate: %d, Frame size: %d.%d", X tty_baud_rate, tty_frame_size >> 1, (tty_frame_size & 1) * 5); X ptextln(temp); X (void) wait_here(); X } X X Xstatic void Xread_opts(argc, argv) Xint *argc; Xchar **argv[]; X { X /* The .termdefs file contains options that are to be used X every time a particular terminal is tested. X File format: X terminal-name options ... X Options for variations should be placed first in the file. X e.g. use vt100-w before vt100, if vt100-w has specific options. X If an exact match is not found, then the base terminal name X will be used. */ X char *opts_filename = ".termdefs"; X int i, j, l, s, state, narg, ch; X FILE *fp; X char *str; X char *new_args[256]; X extern char *getenv(); X X str = getenv("TERM"); X if (strlen(ttytype)) str = ttytype; X for (s = 0; tty_shortname[s] = tty_basename[s] = str[s]; ++s) X if (str[s] == '|') break; X else X if (str[s] == '-') tty_basename[s] = '\0'; X tty_basename[s] = tty_shortname[s] = '\0'; X l = strlen(tty_basename); X X if (str = getenv("HOME")) X sprintf(temp, "%s/%s", str, opts_filename); X else strcpy(temp, opts_filename); X if (!(fp = fopen(temp, "r"))) X { X return; X } X ptext("Searching for "); ptextln(tty_shortname); X state = 0; X narg = 1; X for ( ;; ) { X /* scan past white space */ X for ( ;; ) { X ch = getc(fp); X if (ch == EOF || (ch != ' ' && ch != '\t')) break; X } X if (ch == EOF) break; X for (i = 0; i < sizeof(temp) - 1; i++) { X temp[i] = ch; X if (ch == '\0' || ch == '\n' || ch == '\r' || X ch == EOF || ch == ' ' || ch == '\t') X break; X ch = getc(fp); X } X temp[i] = '\0'; X if (state == 0 && i > 0) X { X if (i == l && !strncmp(temp, tty_shortname, l)) X state = 1; X else X if (i == s && !strncmp(temp, tty_shortname, s)) X state = 1; X else state = 2; X } X else X if (state == 1 && narg < 256 && i > 0) X { X str = (char *) malloc(i + 1); X strcpy(str, temp); X new_args[narg++] = str; X } X if (ch == EOF) break; X else X if (ch == '\r' || ch == '\n') X if (state == 1) break; X else state = 0; X } X fclose(fp); X if (narg == 1) return; X new_args[0] = **argv; X for (j = 1; narg < 256 && j < *argc; ) { X new_args[narg++] = (*argv)[j++]; X } X *argv = (char **) malloc(narg * sizeof(char *)); X *argc = narg; X for (j = 0; j < narg; j++) { X (*argv)[j] = new_args[j]; X } X } X X Xdisplay_sgr(puc) Xchar puc; X { /* print the sgr display for ANSI terminals */ X int k; X X temp[0] = puc; X temp[1] = '\0'; X for (k = 0; k < 80; k++) { X if (char_count + 8 > 80) put_crlf(); X else X if (char_count + 8 > columns) put_crlf(); X else X if (k > 0) printf(" "); X printf("\033[%s%dmMode %2d\033[0m", temp, k, k); X char_count += 8; X if (puc == '\0') X { X if (k == 19) printf("\033[10m"); X if (k == 39) printf("\033[37m"); X if (k == 49) printf("\033[40m"); X } X } X put_crlf(); X if (puc == '<') printf("\033[<1m"); X else X if (puc) printf("\033[%s0m", temp); X set_attr(0); X } X X Xprint_sgr20(on, off) Xint on, off; X { /* print the sgr line for sgr20() */ X if (char_count > columns - 13) X put_crlf(); X else X if (char_count) put_str(" "); X char_count += 11; X printf("%d/%d \033[%dmon\033[%dm off\033[0m", X on, off, on, off); X } X X Xsgr20() X { /* display the enter/exit attributes 1-9 and 20-29 */ X int k; X X ptextln("Test enter/exit attributes 1-9 and 21-29."); X for (k = 1; k < 10; k++) { X print_sgr20(k, k + 20); X } X print_sgr20(1, 22); /* bold */ X print_sgr20(2, 22); /* dim */ X print_sgr20(8, 22); /* blank */ X printf("\033[0m"); X set_attr(0); X } X X Xreset_init(sending) Xint sending; X { /* send the reset and init strings */ X int i; X X can_test("(lines)(cols)(xon)(nxon)"); X#ifdef TESTCAP X can_test("(is2)(rs2)(if)"); X cap_test("pt"); X cap_test("rs"); X if (physical_tabs) X { X if (tab == NULL) tab = "\t"; X if (init_tabs <= 0) init_tabs = 8; X } X /* for some odd reason ATT thinks (rs2) should map to r2 X but the BSD world uses rs. */ X if (reset_2string == NULL) X { X reset_2string = reset_string; X captrans[cap_index("rs2", 3)] = "rs2:rs"; X } X#else X can_test("(is1)(is2)(is3)(rs1)(rs2)(rs3)(iprog)(hts)(tbc)(it)(if)"); X#endif X if (!sending) return; X X if (init_prog) X (void) system(init_prog); X X ptext("Terminal reset"); X i = char_count; X put_name(reset_1string, " (rs1)"); X put_name(reset_2string, " (rs2)"); X put_name(reset_3string, " (rs3)"); X if (i != char_count) put_crlf(); X X ptext(" init"); X put_name(init_1string, " (is1)"); X put_name(init_2string, " (is2)"); X if (set_tab && clear_all_tabs && init_tabs != 8) X { X put_crlf(); X putp(clear_all_tabs); X for (char_count = 0; char_count < columns; char_count++) { X put_this(' '); X if ((char_count & 7) == 7) putp(set_tab); X } X put_cr(); X } X /* run the initialization file */ X if (init_file && init_file[0]) X { X FILE *fp; X int ch; X X if (fp = fopen(init_file, "r")) X { /* send the init file */ X sprintf(temp, " (if) %s", init_file); X ptextln(temp); X while (1) { X ch = getc(fp); X if (ch == EOF) break; X put_this(ch); X } X fclose(fp); X } X else X { X sprintf(temp, "\nCannot open init file (if) %s", init_file); X ptextln(temp); X } X } X put_name(init_3string, " (is3)"); X X fflush(stdout); X sleep(1); X } X X Xmain(argc, argv) Xint argc; Xchar *argv[]; X { X int test_all, cap_x, send_reset_init, list_tested; X int i, j, k, v, hex_out, num_type; X X tty_init(); X char_count = 0; X SETUP; X read_opts(&argc, &argv); X X /* set up the defaults */ X send_reset_init = test_all = translate_mode = replace_mode = 1; X list_tested = 0; X junk_chars = num_type = hex_out = scan_mode = 0; X time_pad = write_ted_file = cap_x = building_cap_list = 0; X stop_testing = select_delay_type = debug_level = 0; X char_mask = STRIP_PARITY; X select_pads = 2; X tty_can_sync = TRUE; X test_length = 5; /* seconds */ X select_xon_xoff = needs_xon_xoff ? 1 : 0; X ACK_char = 6; X tty_ENQ[0] = '\005'; tty_ENQ[1] = '\0'; X X /* scan the option flags */ X for (i = 1; i < argc; i++) { X k = argv[i][0] == '+'; X if (argv[i][0] == '-' | argv[i][0] == '+') X for (j = 1; argv[i][j]; j++) X switch (op_scan(argv[i][j])) { X case 'd': select_delay_type = k; break; X case 'D': X debug_level = 0; X num_type = 'D'; X break; X case 'i': send_reset_init = FALSE; break; X case 'j': num_type = 'j'; break; X case 'n': select_xon_xoff = k; break; X case 'q': tty_can_sync = k; break; X case 'Q': X tty_ENQ[0] = '\0'; X num_type = 'Q'; X break; X case 'T': num_type = 'T'; break; X case 'u': scan_mode = TRUE; X char_mask = ALLOW_PARITY; X break; X case 'x': select_pads = k; break; X case 'X': cap_x = TRUE; break; X default: X break; X } X else X if (argv[i][0] >= '0' && argv[i][0] <= '9') X { X for (j = v = 0; k = argv[i][j]; j++) { X if (k >= '0' & k <= '9') X v = v * 10 + (k - '0'); X else break; X } X switch (num_type) { X case 'D': /* internal debug level */ X debug_level = v; X num_type = 0; X break; X case 'j': /* number of junk characters */ X junk_chars = v; X num_type = 0; X break; X case 'T': /* ENQ terminator (instead of ACK) */ X ACK_char = v; X num_type = 0; X break; X case 'Q': /* ENQ string */ X j = strlen(tty_ENQ); X if (j < sizeof(tty_ENQ) - 1) X { X tty_ENQ[j] = v; X tty_ENQ[j + 1] = '\0'; X } X if (v == 0) num_type = 0; X break; X default: X /* assume its the baud rate */ X tty_frame_size = 20; X tty_baud_rate = v; X num_type = 0; X } X } X } X if (scan_mode) scan_init(tty_basename); X X if (!tty_ENQ[0]) tty_can_sync = 0; X if (cap_x && tty_can_sync) X { X select_xon_xoff = select_pads = TRUE; X } X fflush(stdout); /* flush any output */ X tty_set(); X X go_home(); /* set can_go_home */ X put_clear(); /* set can_clear_screen */ X X reset_init(send_reset_init); X X xon_xoff_state = xon_xoff; X if (xon_xoff = select_xon_xoff) X { /* turn on xon/xoff */ X if (enter_xon_mode) put_name(enter_xon_mode, " (smxon)"); X else X { X ptext("\nPlease set the terminal for XON/XOFF handshaking."); X (void) wait_here(); X } X } X else X if (exit_xon_mode) put_name(exit_xon_mode, " (rmxon)"); X X /* X * I assume that the reset and init strings may not have X * the correct pads. (Because that part of the test comes X * much later.) Because of this, I allow the terminal some X * time to catch up. X */ X fflush(stdout); /* waste some time */ X sleep(1); /* waste more time */ X X if (enter_ca_mode) X { X putp(enter_ca_mode); X put_clear(); /* just incase we switched pages */ X } X X /* turn on/off pads */ X if (select_pads != 2) xon_xoff = select_pads; X X put_crlf(); X for (i = 1; i < argc; i++) { X k = argv[i][0] == '+'; X if (argv[i][0] == '-' | argv[i][0] == '+') { X for (j = 1; argv[i][j]; j++) X switch (op_scan(argv[i][j])) { X case 'a': test_all = 0; X test_charset(); break; X case 'A': test_all = 0; X test_ansi_reports(); break; X case 'c': test_all = 0; X test_color(); break; X case 'C': test_all = 0; X test_move(); break; X case 'e': test_all = 0; X test_report(0, hex_out); break; X case 'E': X char_mask = k ? ALLOW_PARITY : STRIP_PARITY; X break; X case 'f': test_all = 0; X test_funky(hex_out); break; X case 'g': X put_clear(); X for (k = 0; ; ) { X display_sgr(k); X k = wait_here(); X if (k == 'r' || k == 'R') k = 0; X else X if (k < '<' | k > '?') break; X } X sgr20(); X test_all = 0; X (void) wait_here(); X break; X case 'G': test_all = 0; X ansi_graphics(); break; X case 'H': hex_out = k; break; X case 'k': list_tested = 1; X case 'K': building_cap_list = stop_testing = TRUE; X break; X case 'l': test_length = 20; break; X case 'm': test_all = 0; X test_mode(); break; X case 'p': test_all = 0; X test_pad((char *) 0); X break; X case 'P': test_all = 0; X test_printer(); break; X case 'r': resume_testing = TRUE; break; X case 's': test_length = 2; break; X case 'S': test_all = 0; X test_report(1, hex_out); break; X case 't': translate_mode = k; break; X case 'v': test_all = 0; X tty_baud_rate = 0; X verify_time(); X break; X case 'X': X test_all = 0; X if (!tty_can_sync) break; X write_ted_file = time_pad = TRUE; X if (test_length < 10) test_length = 10; X test_pad((char *) 0); X break; X default: X break; X } X } X else X if (argv[i][0] && (argv[i][0] < '0' | argv[i][0] > '9')) X { X#ifdef TESTCAP X extern char *cap_to_info(); X char *info_name; X X info_name = cap_to_info(argv[i]); X if (info_name) test_pad(info_name); X else test_pad(argv[i]); X#else X test_pad(argv[i]); X#endif X if (!cap_tested) X { X sprintf(temp, X "Terminal capability (%s) not tested", argv[i]); X ptextln(temp); X } X test_all = resume_testing = 0; X } X } X X /* Tests may clear screen at the start of the test without waiting X for user input. Tests must wait for the user at the end of X the test group. */ X if (test_all) X { X if (building_cap_list) test_printer(); X else display_basic(); X test_mode(); X test_charset(); X test_color(); X test_move(); X test_funky(hex_out); X test_pad((char *) 0); X } X X if (building_cap_list) print_reported(list_tested); X if (write_ted_file) (void) print_cap_list(); X put_str("\nTerminal test complete\n"); X bye_kids(0); X return (0); X } X X Xbye_kids(n) Xint n; X{ /* reset the tty and exit */ X ignoresig(); X if (exit_ca_mode) putp(exit_ca_mode); X if (xon_xoff_state && enter_xon_mode) putp(enter_xon_mode); X else X if (!xon_xoff_state && exit_xon_mode) putp(exit_xon_mode); X if (debug_fp) fclose(debug_fp); X tty_reset(); X fclose(stdin); X fclose(stdout); X fclose(stderr); X if (not_a_tty) sleep(1); X exit(n); X} END_OF_FILE if test 25007 -ne `wc -c <'ted.c'`; then echo shar: \"'ted.c'\" unpacked with wrong size! fi # end of 'ted.c' fi echo shar: End of archive 5 \(of 7\). cp /dev/null ark5isdone MISSING="" for I in 1 2 3 4 5 6 7 ; do if test ! -f ark${I}isdone ; then MISSING="${MISSING} ${I}" fi done if test "${MISSING}" = "" ; then echo You have unpacked all 7 archives. rm -f ark[1-9]isdone else echo You still need to unpack the following archives: echo " " ${MISSING} fi ## End of shell archive. exit 0 exit 0 # Just in case... -- Kent Landfield INTERNET: kent@sparky.IMD.Sterling.COM Sterling Software, IMD UUCP: uunet!sparky!kent Phone: (402) 291-8300 FAX: (402) 291-4362 Please send comp.sources.misc-related mail to kent@uunet.uu.net.